package cn.tedu.demo.controller;

import cn.tedu.demo.common.Result;
import cn.tedu.demo.entity.Echarts;
import cn.tedu.demo.service.EchartsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/echarts")
public class EchartsController {
    @Autowired
    private EchartsService echartsService;
    @GetMapping()
    public Result<Object> echarts(){
        List<Echarts> echartsList=echartsService.echarts();
        return Result.success(echartsList);
    }
}
